package com.example.springboot.thymeleaf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @desc 注入使用Controller，而不是RestController，因为它是rest接口（json格式），是解析不到html
 * @Author wangsh
 * @date 2018/5/5 15:13
 */
@Controller
@RequestMapping("/templates")
public class ThymeleafController {

	@RequestMapping("/hello.do")
	public String hello(Model model) {
		System.out.println("hello...........");
		model.addAttribute("content", "Thymeleaf 测试");
		return "hello";
	}
}
